<template>
    <div class="box">
        <ul class="ul" v-if="list">
            <li v-for="item in list" :key="item.goods_id">
                <div class="img">
                    <img :src="'https://img.lecuntao.com/data/upload/'+item.goods_pic" alt="">
                </div>
                <p class="js">{{item.goods_name}}</p>
                <div class="bottom">
                    <div class="price">
                        ￥<span class="price-a">{{item.goods_price}}
                        </span>
                    </div>
                    <div class="shopcar">
                        加入购物车
                    </div>
                </div>
            </li>
        </ul>
    </div>
</template>
<script>
import Vue from 'vue'
export default {
  props: ['list']
}
</script>
<style lang="scss" scoped>
.box{
    height: 750px;
}
    .ul{
        width: 90%;
        margin: auto;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        li{
            width: 48%;
            height: 250px;
            // background: red;
            padding:8px;
            box-sizing: border-box;
            border-bottom: 1px solid #ccc;
            .img{
                width: 100%;
                height: 160px;
                // background: red;
                img{
                    width: 100%;
                    height: 100%;
                }
            }
        }
    }
    .js{
        font-size: 15px;
        width: 100%;
        height: 40px;
            color: #111111;
            font-family: "微软雅黑";
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            display: -webkit-box;
    }
    .bottom{
        display: flex;
        justify-content: space-between;
        margin-top: 15px;
        .price{
            font-size: 15px;
            .price-a{
                color:red;
            }
        }
        .shopcar{
            font-size: 15px;
            width: 80px;
            background: red;
            color: red;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }
    }
</style>
